<?php

namespace App\Http\Controllers;

class StringController
{

    public function putObject($ossClient, $bucket)
    {
        $object = "oss-php-sdk-test/upload-test-object-name.txt";

        $content = file_get_contents(__FILE__);

        try{
            $ossClient->putObject($bucket, $object, $content);
        } catch(\OssException $e) {
            printf(__FUNCTION__ . ": FAILED\n");
            printf($e->getMessage() . "\n");
            return;
        }

        print(__FUNCTION__ . ": OK" . "\n");
    }

}
